using Wolfpack.Core;
using Wolfpack.Core.Configuration;
using Wolfpack.Core.Interfaces.Entities;

namespace Wolfpack.Contrib.BuildAnalytics.Parsers.SpecFlow
{
    public class SpecFlowHtmlReportParserConfigurationDiscovery : PluginDiscoveryBase<SpecFlowHtmlReportParserConfig, SpecFlowHtmlReportParser>
    {
        protected override SpecFlowHtmlReportParserConfig GetConfiguration()
        {
            return new SpecFlowHtmlReportParserConfig
                       {
                           Enabled = true,
                           FriendlyId = "CHANGEME!",
                           MatchBuildResult = true,
                           TargetHealthCheckName = "The FriendlyId of the check that triggers this parser",
                           ReportFileTemplate = "report file path, supports {buildid} token",                           
                           ZipFileTemplate = "Report zip filepath (or blank)"
                       };
        }

        protected override void Configure(ConfigurationEntry entry)
        {
            entry.Name = "SpecFlowHtmlReportParser";
            entry.Description = "When triggered (usually by a successful Build Notification check) this plugin will" +
                                "parse a Html SpecFlow report and create notifications for the test statistics";
            entry.Tags.AddIfMissing(SpecialTags.PUBLISHER, "BuildAnalytics", "SpecFlow");
        }
    }
}